import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        conId: {},

        // 默认当前页与每页显示数
        pagedata: {
            pageSize: 1,
            pageNum: 10
        },
        outexcelId: [],
        outclassId: [],
        batchid: [],
        // 表格数据
        tableData: [],
        // 图表数据
        chartData: [],
        xdata: [],
        dodata: [], //业务预约
        makedata: [], //业务办理数
    },
    mutations: {
        // 改变当前页
        changePageSizeData(state, pageSize) {
            state.pagedata.pageSize = pageSize;
        },
        // 改变当前页显示数
        changePageNumeData(state, pageNum) {
            state.pagedata.pageNum = pageNum;
        },

        setId(state, data) {
            //console.log(data);
            state.conId = JSON.parse(JSON.stringify(data))
        },
        setoutexcelId(state, id) {
            state.outexcelId = id;
        },
        setoutexcelclassId(state, classId) {
            state.outclassId = classId;
        },
        // 
        changexdata(state, xdata) {
            state.xdata = xdata;
        },
        changedodata(state, dodata) {
            state.dodata = dodata;
        },
        changemakedata(state, makedata) {
            state.makedata = makedata;
        },
        changeunit(state, unit) {
            state.unit = unit;
        },
        batchid(state, id) {
            state.batchid = id;
        }

    },
    actions: {

    },
    modules: {}
})